package com.study.advice.demo.throwing;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class ThrowingAdvice implements ThrowsAdvice {
    public void afterThrowing(Method method, Object[] args, Object target, Exception ex) {
        System.out.println(method.getName() + " 方法抛出异常：" + ex.getMessage() + "。");
        System.out.println("成功回滚事务。");
    }
}
